'use strict';

var baseController = require('../controllers/Base.server.controller');

module.exports.App = null;
module.exports = function(app) {
    module.exports.App = app;
    app.route('/api/base/uploadFile').post(baseController.uploadFile);
    app.route('/api/base/downloadFile').post(baseController.downloadFile);
    app.route('/api/base/getFileStream').post(baseController.getFileStream);
    app.route('/api/base/getFileStream').post(baseController.getFileStream);
    app.route('/api/base/createExcel').post(baseController.createExcel);
    app.route('/api/base/fileRenames').post(baseController.fileRenames);
    app.route('/api/base/fileDeletes').post(baseController.fileDeletes);
    app.route('/api/base/getSysConstValue').post(baseController.getSysConstValue);
    app.route('/api/base/getSysDateTime').post(baseController.getSysDateTime);
    app.route('/api/base/getGuids').post(baseController.getGuids);    
    
    app.route('/api/fileUpload').post(baseController.fileUpload);

    app.route('/api/base/filesCopy').post(baseController.filesCopy);
    app.route('/api/base/filesUnzip').post(baseController.filesUnzip);
    app.route('/api/base/filesZip').post(baseController.filesZip);

    //跨域设置
 //    app.all('*',function (req, res, next) {
 //    	if(req.method == "OPTIONS"){
	// 	    res.header('Access-Control-Allow-Origin', '*');
	// 		res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Accept, X-Requested-With');
	// 		res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
	// 	}
	//     next();
	// });
};